#include <iostream>
#include <memory>
#include "TcpServer.hpp"

// for debug 用于调试
void DefaultOnMessage(std::shared_ptr<Connection> connection_ptr)
{
    // 上层获取了一条消息
    std::cout << "Main Get a Message: " << std::endl
              << connection_ptr->Cstr() << std::endl;
}

int main()
{
    // std::cout << "hello world" << std::endl;
    std::shared_ptr<TcpServer> svr(new TcpServer(8050, DefaultOnMessage));
    svr->Init();
    svr->Loop();
    return 0;
}